﻿package core.model
{
    import com.adobe.cairngorm.model.IModelLocator;
    

    [Bindable]
    public class AppModel implements IModelLocator
    {        
        private static var instance:AppModel;
    
        public function AppModel(enforcer:SingletonEnforcer) {
            if (enforcer == null) {
                throw new Error( "You Can Only Have One ModelLocator" );
            }
        }

        public static function getInstance() : AppModel {
            if (instance == null) {
                instance = new AppModel( new SingletonEnforcer );
            }
            return instance;
        }
        
        
    }
        
}
class SingletonEnforcer {}